import Vue from 'vue'
import VueRouter from 'vue-router'
import index from "../views/index/index";
import newsIn from "../views/news/newsIn";
import laboratoryIn from "../views/laboratory/laboratoryIn";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/index"
    // component: Home
  },
  {
    path: '/index',
    name: 'index',
    component: index
  },
  {
    path: '/productPage',
    name: 'productPage',
    component: () => import('../views/productPage/productPage')
  },
  {
    path: "/laboratory",
    name:"laboratory",
    component: () => import('../views/laboratory/laboratory')
  },
  {
    path: "/news",
    name:"news",
    component: () => import('../views/news/news'),
    children:[
      {
        path:'newsIn',
        name:'newsIn',
        component: newsIn
      },
      {
        path: 'laboratoryIn',
        name: 'laboratoryIn',
        component: laboratoryIn
      }
    ]
  },
  {
    path: "/aboutUs",
    name:"aboutUs",
    component: () => import('../views/aboutUs/aboutUs')
  },
  {
    path: "/detailsForNews",
    name:"detailsForNews",
    component: () => import('../views/detail/detailsForNews'),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
